package com.bafa.dbcache;

import java.io.IOException;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.bafa.debug.Debug;

public class StartupServlet extends HttpServlet {


	public static String dbname;
	public static String dbhost;
	public static String dbuser;
	public static String dbpassword;
	@Override
	public void init(ServletConfig config) throws ServletException {
	
		dbhost = config.getInitParameter("dbhost");
		dbname = config.getInitParameter("dbname");
		dbuser = config.getInitParameter("dbuser");
		dbpassword = config.getInitParameter("dbpassword");
		System.out.println("DEBUG PARAM "+config.getInitParameter("debug"));
		Debug.debug = (config.getInitParameter("debug").equalsIgnoreCase("true"));
		System.out.println("IS DEBUG ON: "+Debug.debug);
		LeagueCache.refreshAll();
	}
	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
	}

}
